<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div>{{msg}}</div>
        <input type="text" :value="msg" v-on:input="handle" />
        <input type="text" :value="msg" v-on:input="msg=$evnet.target.value" " />
    </div>

    <script src="./vue.js "></script>
    <script>
      var vm = new Vue({
        el: "#app ",
        data: {
          msg: "hello ",
        },
        methods: {
          handle: function (event) {
            this.msg = event.target.value;
            //使用输入域中的最新的数据覆盖原来的数据
          },
        },
      });
    </script>
  </body>
</html>